package itcast.web.servlet;

import itcast.domain.Build;
import itcast.domain.Outt;
import itcast.service.BuildService;
import itcast.service.OuttService;
import itcast.service.impl.BuildServiceImpl;
import itcast.service.impl.OuttServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/student_outServlet")
public class Student_outServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //1.调用outtService完成查询
        OuttService service=new OuttServiceImpl();
        List<Outt> outts=service.findstudent_out();
        //2.将list存入request域
        request.setAttribute("outts",outts);
        //3.转发到student_outt .jsp
        request.getRequestDispatcher("/systemadmin/student_out.jsp").forward(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        this.doPost(request,response);
    }
}
